package cn.net.cfss.fgbp.api.console.inte;

import cn.net.cfss.fgbp.api.console.constant.Constants;
import cn.net.cfss.fgbp.api.console.dto.SysApplicationDto;
import cn.net.cfss.fgbp.api.console.vo.SysApplicationVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author oygq
 * @title: IApplicationService
 * @description: TODO
 * @date 2019/4/3 11:15
 */

@FeignClient(name = Constants.SPI_SERVER_NAME)
@RequestMapping("application")
public interface ISysApplicationService {

    @RequestMapping(value = "/add", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean insert(@RequestBody SysApplicationVo vo);

    @RequestMapping(value = "/edit", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean update(@RequestBody SysApplicationVo vo);

    @RequestMapping(value = "/delete/{appId}", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean delete(@PathVariable(value = "appId") Long appId);

    @RequestMapping(value = "/query/{appId}", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public SysApplicationDto queryById(@PathVariable(value = "appId") Long appId);

    @RequestMapping(value = "/query/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public List<SysApplicationDto> queryList(@RequestBody SysApplicationVo vo);

    @RequestMapping(value = "/query/auth/{roleId}", method = RequestMethod.GET)
    public List<Long> queryByRoleId(@PathVariable(value = "roleId") Long roleId);

    @RequestMapping(value = "/deleteBatch" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean deleteBatch(@RequestBody List<Long> ids);

    @RequestMapping(value = "/query/auth/{roleCode}", method = RequestMethod.GET)
    public List<SysApplicationDto> queryByRoleId(@PathVariable(value = "roleCode") String roleCode);

    @RequestMapping(value = "/uniquenessCheck", method = RequestMethod.GET)
    public boolean uniquenessCheck(@RequestParam("permission") String permission,@RequestParam(value = "id",required=false) Long id);


}

